console.log("9999");

const defaultState = {
    user_info: "",
    user_auth: [],
    user_token: "",
};
export default (state = defaultState, action) => {
    for (let key in state) {
        console.log(action.type, "action.type", key);
        if (action.type === key) {
            const newState = JSON.parse(JSON.stringify(state));
            newState[key] = action.value;
            return newState;
        }
    }
    // if (action.type === state) {
    //     const newState = JSON.parse(JSON.stringify(state));
    //     newState.info = action.value;
    //     return newState;
    // }
    // if (action.type === "USER_AUTH") {
    //     const newState = JSON.parse(JSON.stringify(state));
    //     newState.info = action.value;
    //     return newState;
    // }
    // if (action.type === "USER_TOKEN") {
    //     const newState = JSON.parse(JSON.stringify(state));
    //     newState.info = action.value;
    //     return newState;
    // }
    return state;
};